SPEED=$1
BUFFER_SIZE=$2
mmdelay=$3
cc_name=$4

dst=$5

echo $SPEED $BUFFER_SIZE $mmdelay $cc_name


sudo sysctl -w net.ipv4.tcp_congestion_control=${cc_name}
sudo sysctl -a | grep net.ipv4.tcp_congestion_control

sudo ethtool -K enp1s0 gso off
sudo ethtool -K enp1s0 tso off
sudo sysctl -w net.ipv4.tcp_sack=0

sudo tcpdump -i ingress -s 61 dst ${dst} or src ${dst} -w cellsim_hombre_vm_${SPEED}_${BUFFER_SIZE}_${mmdelay}_${cc_name}.pcap  &

sleep 1
iperf3 -c ${dst} -t 30 &
sleep 31

sudo pkill -9 iperf3
sleep 1
sudo pkill -9 tcpdump
